% 输入三个点的坐标
x1=-1;y1=0;
x2=2;y2=0;
x3=0;y3=2;

% 定义的各种系数
a1=x2*y3-y2*x3;
a2=x3*y1-y3*x1;
a3=x1*y2-y1*x2;

b1=y2-y3;
b2=y3-y1;
b3=y1-y2;

c1=x3-x2;
c2=x1-x3;
c3=x2-x1;

% 坐标变换矩阵
delta_e=1/2*(b1*c2-b2*c1);
matToXY=[
    c2,-c1;
    -b2,b1];
vec1=[x3;y3];